package com.zr.kufangkuwei.mapper;

import com.zr.kufangkuwei.pojo.*;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import javax.validation.Valid;
import java.util.List;

/**
 * Created by Administrator on 2019/7/16.
 */
@Mapper
public interface KuFangMapper {


    int queryCount(DepotareaSelectVo depSelectVo);

    List<Depotarea> queryPage(DepotareaSelectVo depotareaSelectVo);

    @Update("update depotposition set positionName=#{positionName} where id=#{id}")
    int update(Depotposition depotposition);

    @Select("select depotCode,depotname from depot where id=#{id}")
    List<Depot> queryDepot(Integer id);

    @Select("select Areaname,areacode from where depotarea depotId=#{depotId}")
    List<Depotarea> queryDepotarea(Integer id);

    @Insert("insert into depotposition (positionName,PositioncCode) values (#{positionName},#{PositioncCode})")
    int addDepotarea(@Valid DepotareaAddVo depotareaAddVo);

    @Insert("insert depot (depotCode,depotname) values (#{depotCode},#{depotname})")
    int addDepotList(List<Depot> depotList);

    @Insert("insert depotarea (Areaname,areacode) values (#{Areaname},#{areacode})")
    int addDepotareaList(List<Depotarea> depotareaList);
}
